package com.charles.spring.ch3.conditional;

import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
import org.springframework.context.annotation.Condition;

/**
 * Created by charles on 2017/5/3.
 */
public class WindowsCondition implements Condition {
    public boolean matches (ConditionContext context, AnnotatedTypeMetadata metadata) {
        return context.getEnvironment().getProperty("os.name").contains("Windows");
    }
}
